﻿@{
	Layout = "layout.cshtml";
}

<div class="index">
	@foreach(var cat in Model.Categories) {
	<div class="category">
		<h2>@cat.Name</h2>
		
		@foreach(var type in cat.Types) {
			var link = type.Name + ".html";
			
			<h3><a href="@link">@type.Name</a></h3>
			<p>@Raw(type.Summary)</p>
		}
	</div>
	}
</div>

<div class="type">
	<h2>@Model.Type.Name</h2>
	<p>@Raw(Model.Type.Summary)</p>

	@if (Model.Type.Ctors.Length > 0) {
	<h3>Constructors</h3>
	foreach(var ctor in Model.Type.Ctors) {
	<div class="method">
		<p>
			<strong>@ctor.Name</strong>
		</p>
		@foreach(var arg in ctor.Args) {
		<div class="arg">
			<p>
				@arg.Name : <i>@arg.Type.Name</i>
			</p>
		</div>
		}
		<p>@Raw(ctor.Summary)</p>
	</div>
	}
	}

	@if (Model.Type.Methods.Length > 0) {
	<h3>Methods</h3>
	foreach(var method in Model.Type.Methods) {
	<div class="method">
		<p>
			<strong>@method.Name</strong> : <i>@method.ReturnType.Name</i>
		</p>
		@foreach(var arg in method.Args) {
		<div class="arg">
			<p>
				@arg.Name : <i>@arg.Type.Name</i>
			</p>
		</div>
		}
		<p>@Raw(method.Summary)</p>
		@if(!string.IsNullOrWhiteSpace(method.Example)) {
		<div class="example">
			<p>Example:</p>
			<pre>@Raw(method.Example)</pre>
		</div>
		}
	</div>
	}
	}

	@if (Model.Type.Properties.Length > 0) {
	<h3>Properties</h3>
	foreach(var property in Model.Type.Properties) {
	<div class="property">
		<p>
			<strong>@property.Name</strong> : <i>@property.Type.Name</i>
		</p>
		<p>@Raw(property.Summary)</p>
	</div>
	}
	}
</div>
